package com.mykt.controller;

import com.mykt.baseResult.BaseController;
import com.mykt.baseResult.RespondsResult;
import com.mykt.service.LoginService;
import com.mykt.view.param.LoginParam;
import com.mykt.view.vo.LoginResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TokenController extends BaseController {

    @Autowired
    private LoginService loginService;

    @PostMapping(value = "/login")
    public RespondsResult<LoginResultVo> login(@RequestBody LoginParam loginBody){
       return responds(loginService.login(loginBody.getUserName(), loginBody.getPassword()));
    }

}
